package cn.lblbc.cootext

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.widget.TextView

class ExportActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_export)
        
        val exportedContent = intent.getStringExtra("EXPORTED_CONTENT") ?: ""
        val searchTerm = intent.getStringExtra("SEARCH_TERM") ?: ""
        
        val textView = findViewById<TextView>(R.id.exportedTextView)
        textView.text = exportedContent
        
        // 设置标题为"包含[搜索词]的行"
        supportActionBar?.title = "包含\"$searchTerm\"的行"
        supportActionBar?.setDisplayHomeAsUpEnabled(true)
    }
    
    override fun onSupportNavigateUp(): Boolean {
        finish()
        return true
    }
}